//microcommand define mute
signature("<user:user> [minutes:posint]", { showWarning: true, checkUnknown: true, authority: 3 })
option("unmute", "-u")
option("guild", "-g <id>", { authority: 3, descPath: "lnnbot.admin.guild-option" })
option("reason", "-r <text:rawtext>")
action(async ({ session, options }, user, minutes) => {
if (session.isDirect && !options.guild) return session.i18n("lnnbot.admin.not-in-guild")
if (!user) return session.i18n("internal.insufficient-arguments")
const [, platform, userId] = /([^:]*):(.*)/.exec(user)
if (platform !== session.platform) return session.i18n("lnnbot.admin.invalid-user-platform")
await session.bot.muteGuildMember(options.guild || session.guildId, userId, options.unmute ? 0 : (minutes || 10) * 60000, options.reason)
})
locale("zh-CN", {
description: "禁言用户",
options: {
unmute: "解除禁言",
reason: "指定禁言说明",
},
})